package exame_05_06_2012;

import java.io.IOException;
import java.util.ArrayList;

public class Coisas {
	public static void main(String[] args) {
		MyMap map = new MyMap();
		Veiculo v = new Van("GN", new ArrayList<Contratavel>(), 0, 0);
		map.put(v.getMatricula(), v);

		v = new Van("NG", new ArrayList<Contratavel>(), 0, 0);
		map.put(v.getMatricula(), v);

		v = new Van("PM", new ArrayList<Contratavel>(), 0, 0);
		map.put(v.getMatricula(), v);

		map.put(v.getMatricula(), v);

		map.put(v.getMatricula(), v);

		System.out.println("hascode: " + v.hashCode() + "equlas ?"
				+ v.equals(v));

		v = new Van("MP", new  ArrayList<Contratavel>(), 0, 0);
		map.put(v.getMatricula(), v);

		Veiculo ng = map.get("NG");
		System.out.println(ng.getMatricula());

		if (map.containsKey("PM")) {
			System.out.println("Great");
		}

		System.out.println("size: " + map.values().size());

		try {
			map.gravaMyMap("cenas.dat", 0);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("Fim");
	}
}
